package cn.ljy.uem.web.action.backstage.project;

import cn.ljy.authority.web.controller.backstage.BaseBackstageController;
import cn.ljy.common.model.result.ResponseData;
import cn.ljy.uem.model.Project;
import cn.ljy.uem.model.ProjectMenberDaily;
import cn.ljy.uem.model.query.ProjectMenberDailyQuery;
import cn.ljy.uem.model.query.ProjectQuery;
import cn.ljy.uem.service.ProjectMenberDailyService;
import cn.ljy.uem.service.ProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;


/**
 * 工作日志控制器
 *
 * @author 小锋
 * @date 2023/01/26
 */
@Api(tags = "后台的项目工作日志模块")
@RestController
@RequestMapping(value = "/api/backstage/school/projectMenberDaily")
public class projectMenberDailyController extends BaseBackstageController<ProjectMenberDaily, ProjectMenberDailyQuery, String> {

    @Autowired
    private ProjectMenberDailyService baseService;

    @ApiOperation(value = "查询所有工作日志")

    @GetMapping("/all")
    @Override
    protected ResponseData query(ProjectMenberDailyQuery query) {
        return super.query(query);
    }

    @ApiOperation(value = "分页查询工作日志")
    @Override
    public ResponseData query(Integer page, Integer pageSize, ProjectMenberDailyQuery query){
        return super.query(page,pageSize,query);
    }

    @ApiOperation(value = "读取工作日志")
//    @PreAuthorize("hasAuthority('sys:Project:query')")
    @Override
    protected ResponseData get(@PathVariable("id") String id) {
        return super.get(id);
    }

    @ApiOperation(value = "批量删除指定的工作日志")
//    @PreAuthorize("hasAuthority('sys:Project:del')")
    @Override
    protected ResponseData deletes(@NotEmpty(message = "操作失败：请选择要移除的记录") String[] ids) {
        return super.deletes(ids);
    }


    @ApiOperation(value = "添加工作日志")
//    @PreAuthorize("hasAuthority('sys:Project:add')")
    @Override
    protected ResponseData add(@Valid @RequestBody ProjectMenberDaily projectMenberDaily) {
        return super.add(projectMenberDaily);
    }

    @ApiOperation(value = "编辑工作日志")
    @Override
    protected ResponseData edit(@Valid @RequestBody ProjectMenberDaily projectMenberDaily) {
        return super.edit(projectMenberDaily);
    }



}
